<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<%@ page isELIgnored="false"%>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type='text/javascript' src='../js/Ajax.js'></script>
		<script type='text/javascript' src='../dwr/engine.js'></script>
		<script type='text/javascript' src='../dwr/util.js'></script>
		<script type='text/javascript' src='../script/shop/checkout.js'></script>
		<script type='text/javascript' src='../script/shop/opendiv.js'></script>
		
		<title>填写核对订单信息</title>
		<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/css/css.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
    #fg{
    width:100%;
    height:215%;
    background:black;
    position:absolute;
    left:0;
    top:0;
    z-index:1;
    display:none;
    filter:alpha(opacity=50);
    opacity:0.4; 
   } 
   
   .ceng2{padding-left:15px;}
   </style>
		
		
	</head>

	<body>
		<html:form action ="/order/submitOrder.do"  method="post">
		<input type="hidden" name="m" value="addOrder"/>
			<div class="bg">
				<div class="bg_inside" style="float:none;">
					<div class="cont">
						<div class="cont_top;float:none;">
							<div style="float: left">
								<img src="${ctx}/images/logo.jpg" /border="0">
							</div>
							<div style="float: right; margin-top: 25px">
								<img src="${ctx}/images/checkout_status.jpg" />
							</div>
							<div class="clearAll" ></div>
						</div>
						<div class="cont_new" id="addressDiv" style="display: none;float:none;">
							<ul style="float:none;">
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
									<img src="${ctx}/images/title_letter_icon.jpg" />
									收货人信息 [
									<a
										href="javascript:openDiv('addressDiv','updateAddressDiv'),closeDom('updatePayDiv'),closeDom('updateDeliverDiv'),closeDom('payDiv'),closeDom('deliverDiv'),closeDom('bigdiv');">修改</a>]
								</li>
								
								<li style="float:none;">
								<input type="hidden" name="historySize" value="${historySize}"/>
									收货人姓名：
									<span id="consignee"></span>
									<input type="hidden" name="consignee" id="hiddconsignee" value=""/>
								</li>
								<li style="float:none;">
									省 份：
									<span id="province"></span>
									<input type="hidden" name="city" id="hiddcity" value=""/>
									<input type="hidden" name="ocity" id="hiddocity" value=""/>
								</li>
								<li style="float:none;"><span>
									地 址：</span>
									<span id="address"></span>
									<input type="hidden" name="address" id="hiddaddress" value=""/>
									<div class="clearAll"></div>
								</li>
								<li style="float:none;">
									<span>
									邮 编：</span>
									<span id="postcode"></span>
									<input type="hidden" name="postcode" id="hiddpostcode" value=""/>
									<div class="clearAll"></div>
								</li>
								<li style="float:none;"><span>
									固定电话：</span>
									<span id="phone">${firstMap.phone}</span>
									<input type="hidden" name="phone" id="hiddphone" value=""/>
									<div class="clearAll"></div>
								</li>
								<li style="float:none;"><span>
									手机号码：</span>
									<span id="mobile"></span>
									<input type="hidden" name="mobile" id="hiddmobile" value=""/>
									<div class="clearAll"></div>
								</li>
								<li style="float:none;"><span>
									电子邮件：</span>
									<span id="email"></span>
									<input type="hidden" name="email" id="hiddemail" value=""/>
									<div class="clearAll"></div>
								</li>
							</ul>
						</div>
						<div class="cont_modify" id="updateAddressDiv" style="float:none;">
							<ul style="float:none;">
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
									<img src="${ctx}/images/title_letter_icon.jpg" />
									收货人信息
									<!--  [<a href="">管理我的收货地址</a>] -->
								</li>
							</ul>
							<ul style="float:none;">
							<!--在request中获取数据-->
							<logic:present name="list" scope="request">
								<!--循环数据-->
								<logic:iterate id="ch" name="list" indexId="idd">

										<li style="float:none;">
											<label>
												<input type="radio" name="radioAddress" value="${idd}"
													onclick="javascript:openDiv(getIsDivID(),'${ch.oid}'),inputDivId('${ch.oid}')" />
											</label>
											收货人姓名：${ch.consignee}＼手机：${ch.mobile}＼收货地址：${ch.address}
										</li>
										<ul id="${ch.oid}" style="display: none;float:none;">
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												收货人姓名：</div>
												<label>
													<input type="text" id="textUserName${idd}" value="${ch.consignee}"
														/ class="cont_input">
												</label>
												<span style="color: #FF6600">*</span>
												<div class="clearAll"></div>
											</li>
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												您所在的地区： </div>省份
												<label>
													<select id="selectProvince${idd}">
														<option value="${ch.province}" checked="true">
														${ch.province}
														</option>
													</select>
												</label>
												城市
												<label>
													<select id="selectCity${idd}" name="selectCity">
														<option value="${ch.city}" checked="true">
														${ch.city}
														</option>
													</select>
												</label>
												区县
												<label>
													<select id="selectVillage${idd}">
														<option value="${ch.village}" checked="true">
														${ch.village}
														</option>
													</select>
												</label>
												<span style="color: #FF6600">*</span>
												<div class="clearAll"></div>
											</li>
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												地址：</div>
												<label>
													<input type="text" id="textAddress${idd}" value="${ch.address}" maxlength="255"
														/  class="cont_input_add">
												</label>
												<span style="color: #FF6600">*</span>
												<div class="clearAll"></div>
											</li>
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												邮编：</div>
												<label>
													<input type="text" id="textzip${idd}" value="${ch.postcode}" maxlength="6"
														/ class="cont_input">
												</label>
												<span style="color: #FF6600">*</span>
												<div class="clearAll"></div>
											</li>
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												固定电话：</div>
												<label>
													<input type="text" id="textphone${idd}" value="${ch.phone}" maxlength="16"
														/ class="cont_input">
												</label>
												<div class="clearAll"></div>
											</li>
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												手机号码：</div>
												<label>
													<input type="text" id="textmobile${idd}" value="${ch.mobile}" maxlength="11"
														/ class="cont_input">
												</label>
												<span style="color: #FF6600">*</span>
												<div class="clearAll"></div>
											</li>
											<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
												电子邮件：</div>
												<label>
													<input type="text" id="textemail${idd}" value="${ch.email}"
														/ class="cont_input">
												</label>
												<span style="color: #FF6600">*</span>
												<div class="clearAll"></div>
											</li>
										</ul>
								</logic:iterate>
							</logic:present>
						
								<li style="float:none;">
									<label>
										<input type="radio" name="radioAddress" value="3" checked="checked"
											onclick="javascript:openDiv(getIsDivID(),'otherAddress'),inputDivId('otherAddress');" />
									</label>
									使用其他地址
								</li>
							
							<div id="otherAddress" style="display:block;">
								<ul style="float:none;">
									<li style="float:none;">
									<div style="width:90px;height:30px;float:left;text-align:right;">
										收货人姓名：
									</div>
										<label>
											<input type="text" id="textUserName3" / class="cont_input">
										</label>
										<span style="color: #FF6600">*</span>
										<div class="clearAll"></div>
									</li>
									<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
										您所在的地区： </div>省份
										<label>
											<select id="selectProvince3" >
											</select>
										</label>
										城市
										<label>
											<select id="selectCity3">
											</select>
										</label>
										区县
										<label>
											<select id="selectVillage3">
											</select>
										</label>
										<span style="color: #FF6600">*</span>
										<div class="clearAll"></div>
									</li>
									<li style="float:none;">
									<div style="width:90px;height:30px;float:left;text-align:right;">
										地址：</div>
										<label>
											<input type="text" id="textAddress3" maxlength="255" /  class="cont_input_add">
										</label>
										<span style="color: #FF6600">*</span>
										<div class="clearAll"></div>
									</li>
									<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
										邮编：</div>
										<label>
											<input type="text" id="textzip3" maxlength="6" / class="cont_input">
										</label>
										<span style="color: #FF6600">*</span>
										<div class="clearAll"></div>
									</li>
									<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
										固定电话：</div>
										<label>
											<input type="text" id="textphone3" maxlength="16" / class="cont_input">
										</label>
										<div class="clearAll"></div>
									</li>
									<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
										手机号码：</div>
										<label>
											<input type="text" id="textmobile3" maxlength="11" / class="cont_input" >
										</label><span style="color: #FF6600">*</span>
										<div class="clearAll"></div>
									</li>
									<li style="float:none;"><div style="width:90px;height:30px;float:left;text-align:right;">
										电子邮件：</div>
										<label>
											<input type="text" id="textemail3" / class="cont_input">
										</label>
										<span style="color: #FF6600">*</span>
										<div class="clearAll"></div>
									</li>
									<li style="padding-left:125px;width:600px;float:none;">
									    <span style="color: #FF6600;">*</span>为必填项目
									</li>
								</ul>
							</div>
							</ul>
							<ul style="float:none;">
								<li
									style="padding-left: 25px; margin-bottom: 20px; width: 200px;float:none;">
									<a
										href="javascript:editAddressDiv();"
										class="reg_button ">确认收货人信息</a>
								</li>

							</ul>
							
						</div>
						<div class="cont_new" id="payDiv" style="display: none;float:none;">
							<ul style="float:none;">
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
									<img src="${ctx}/images/title_letter_icon.jpg" />
									付款方式 [
									<a href="javascript:getPayment();openDiv('payDiv','updatePayDiv'),closeDom('updateAddressDiv'),closeDom('updateDeliverDiv'),closeDom('deliverDiv'),openDom('addressDiv'),closeDom('bigdiv');">修改</a>]
								</li>
								<li style="float:none;">
									<span id="spanpname"></span>
									<input type="hidden" name="pname" id="hiddpname" value=""/><!-- 下页显示内容 -->
									<input type="hidden" name="paymentid" id="hiddpaymentid" value=""/><!-- 付款方式id -->
									<input type="hidden" name="payBank" id="payBank" value=""/><!-- 信用卡专用：付款银行 -->
									<input type="hidden" name="payBankPoundage" id="payBankPoundage" value=""/><!-- 信用卡专用：期数和手续费 -->
								</li>

							</ul>
						</div>
						<div class="cont_modify" style="display: none;float:none;" id="updatePayDiv">
							<ul style="float:none;">
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
									<img src="${ctx}/images/title_letter_icon.jpg" />
									付款方式
								</li>
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
       <div  class="ceng2" id="ceng201" style="display:none"><input type="radio" name="radio"  value="1,支付宝" onclick="javascript:show0('ceng30');"/>支付宝</div>
             <div class="ceng3" id="ceng30" style="padding-left:30px; clear:both;display:none">
                    说明：<br/>
                    温馨提示：
             </div><!--ceng3-->
       <div  class="ceng2" id="ceng202" style="display:none"><input type="radio" name="radio"  value="2,快钱" onclick="javascript:show0('ceng31');"/>快钱</div>
             <div class="ceng3" id="ceng31" style="padding-left:30px; clear:both;display:none">
                    说明：<br/>
                    温馨提示：
             </div><!--ceng3-->
       <div  class="ceng2" id="ceng203" style="display:none"><input type="radio" name="radio"  value="4,上门自提" onClick="javascript:show0('ceng32');"/>上门自提</div>
            <div class="ceng3" id="ceng32" style="padding-left:30px; clear:both;display:none">
             地址：<br/>
             温馨提示：
            </div><!--ceng3-->
        <div  class="ceng2" id="ceng204" style="display:none"><input type="radio" name="radio"  value="3,信用卡分期付款" onClick="javascript:show0('ceng33');"/>信用卡分期付款</div>
            <div class="ceng3" id="ceng33" style="display:none">
 <!-- 信用卡开始-->
                <div style="padding-left:30px; clear:both">
                     <input type="radio" name="radio_a5" id="" onclick="javascript:show2('ceng407')" value="中国银行" />
                         中国银行（购物金额需大于1000元）<a target="_blank" href="${ctx}/pages/safeai/jsp/shoppingcart/fenqi.jsp">详情</a>
                </div>
                <div class='ceng4' id="ceng407" style="display:none">
                     <div class="content_02" style="padding-left: 80px;">
                     <input type="radio" name="radio_a5Item1" onclick="" id="radio16" value="3,0.04" />
                     3期，收取4%手续费。
                     </div>
                    <div class="content_02" style="padding-left: 80px;">
                         <input type="radio" name="radio_a5Item1" onclick="" id="radio17" value="6,0.06" />
                         6期，收取6%手续费。
                    </div>
                    <div class="content_02" style="padding-left: 80px;">
                         <input type="radio" name="radio_a5Item1" onclick="" id="radio18" value="12,0.08" />
                         12期，收取8%手续费。
                    </div>
                </div>
                <div style="padding-left:30px; clear:both">
                     <input type="radio" name="radio_a5" id="a5Item2" value="兴业银行" onclick="javascript:show2('ceng408')" />
                        兴业银行（购物金额需大于1000元）<a target="_blank" href="${ctx}/pages/safeai/jsp/shoppingcart/fenqi.jsp">详情</a>
                </div>
                <div class='ceng4' id="ceng408" style="display:none">
                     <div class="content_02" style="padding-left: 80px;">
                          <input type="radio" name="radio_a5Item2" onclick="" id="radio19" value="3,0.04" />
                           3期，收取4%手续费。
                     </div>
                     <div class="content_02" style="padding-left: 80px;">
                          <input type="radio" name="radio_a5Item2" onclick="" id="radio20" value="6,0.06" />
                          6期，收取6%手续费。
                     </div>
                     <div class="content_02" style="padding-left: 80px;">
                     <input type="radio" name="radio_a5Item2" onclick="" id="radio21" value="12,0.08" />
                      12期，收取8%手续费。
                     </div>
                </div>
                <div style="padding-left:30px; clear:both">
                     <input type="radio" name="radio_a5" id="rKQXY" onclick="javascript:show2('ceng409')" value="快钱信用卡网上支付" />
                         快钱信用卡网上支付<span class="cred1">（毋需开通网上银行，支持中行、建行、工行、兴业、<br />&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp民生、浦发、广发、华夏、上海银行、深圳平安银行，收取2%手续费。）</span>
                </div>
                <div class='ceng4' id="ceng409" style="display:none">
                </div>
<!-- 信用卡结束 -->
            </div><!--ceng3-->
        <div  class="ceng2" id="ceng205" style="display:none"><input type="radio" name="radio"  value="5,货到付款" onClick="javascript:show0('ceng34');"/>货到付款</div>
            <div class="ceng3" id="ceng34" style="padding-left:30px; clear:both;display:none">
             声明：
            </div><!--ceng3-->
        <div  class="ceng2" id="ceng206" style="display:none"><input type="radio" name="radio"  value="6,银行转账/汇款" onClick="javascript:show0('ceng35');"/>银行转账/汇款</div>
            <div class="ceng3" id="ceng35" style="padding-left:30px; clear:both;display:none">
            说明:
            </div><!--ceng3-->
        <div  class="ceng2" id="ceng207" style="display:none"><input type="radio" name="radio"  value="7,货到POS机刷卡" onClick="javascript:show0('ceng36');"/>货到POS机刷卡</div>
            <div class="ceng3" id="ceng36" style="padding-left:30px; clear:both;display:none">
             说明:
            </div><!--ceng3--></li>
								
								<li
									style="padding-left: 25px; margin-bottom: 20px; width: 200px;float:none;">
									<a href="javascript:editPayDiv();"
										class="reg_button ">确认付款方式</a>
								</li>
							</ul>
						</div>
						<div class="cont_new" id="deliverDiv" style="display: none;float:none;">
							<ul style="float:none;">
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
									<img src="${ctx}/images/title_letter_icon.jpg" />
									配送方式 [
									<a
										href="javascript:openDiv('deliverDiv','updateDeliverDiv'), closeDom('updatePayDiv'),closeDom('updateAddressDiv'),openDom('payDiv'),openDom('addressDiv'),closeDom('bigdiv');">修改</a>]
								</li>
								<li style="float:none;">
									<span id="spandeliver">${firstMap.dname}</span>
									<input type="hidden" name="deliverid" id="deliverid" value="${firstMap.deliverid}"/>
								</li>
							</ul>
						</div>
						<div class="cont_modify" style="display: none;float:none;" id="updateDeliverDiv">
							<ul  style="float:none;">
								<li style="color: #5a3e2e; padding-left: 15px;float:none;">
									<img src="${ctx}/images/title_letter_icon.jpg" />
									配送方式
								</li>
								<div style="width:0;height:0;margin:0;padding:0;font-size:0;clear:both;"></div>
                                    <div  class="ceng2" id="ceng208" style="display:none"><input type="radio" name="radiopay"  value="2,顺丰速运" onClick="javascript:show1('pay02');"/>顺丰速运</div>
                                        <div class="ceng3" id="pay02" style="padding-left:30px; clear:both;display:none">
                                                   说明:
                                        </div><!--ceng3-->
                                    <div  class="ceng2" id="ceng211" style="display:none"><input type="radio" name="radiopay"  value="5,EMS" onClick="javascript:show1('pay05');"/>EMS</div>
                                        <div class="ceng3" id="pay05" style="padding-left:30px; clear:both;display:none">
                                                   说明:
                                        </div><!--ceng3-->
                                    <div  class="ceng2" id="ceng212" style="display:none"><input type="radio" name="radiopay"  value="6,圆通快递" onClick="javascript:show1('pay06');"/>圆通快递</div>
                                        <div class="ceng3" id="pay06" style="padding-left:30px; clear:both;display:none">
                                                   说明:
                                        </div><!--ceng3-->
                                    <div  class="ceng2" id="ceng215" style="display:none"><input type="radio" name="radiopay"  value="9,上门自提" onClick="javascript:show1('pay09');"/>上门自提</div>
                                        <div class="ceng3" id="pay09" style="padding-left:30px; clear:both;display:none">
                                                   说明:
                                        </div><!--ceng3-->
                                    <div  class="ceng2" id="ceng216" style="display:none"><input type="radio" name="radiopay"  value="10,货到付款（北京）" onClick="javascript:show1('pay10');"/>货到付款（北京）</div>
                                        <div class="ceng3" id="pay10" style="padding-left:30px; clear:both;display:none">
                                                   说明:
                                        </div><!--ceng3-->
								<li style="padding-left: 25px; margin-bottom: 20px; width: 200px;float:none;">
									<a href="javascript:editDeliverDiv();" class="reg_button ">确认配送方式</a>
								</li>
							</ul>
						</div>
						<div style="display:none" id="bigdiv"><!-- 大div开始-->
						<div class="cart_cont" style="float:none;">
							<ul style="float:none;">
								<li style="color: #5a3e2e;float:none;">
									<span style="margin: 0px">商品图片</span><span
										style="width: 280px; margin: 0px">商品名称</span><span
										style="margin: 0px">商品单价</span><span style="margin: 0px">单品小计</span>
									<span style="margin: 0px">赠送积分</span>
									<span style="margin: 0px">是否开发票</span>
									<span style="margin: 0px">选购数量</span>
									<div class="clearAll"></div>
								</li>
								<!--在session中获取购物车数据-->
								<logic:present name="ShoppingCart" scope="session">
									<!--循环购物车数据-->
									<logic:iterate id="sc" name="ShoppingCart">
									<input type="hidden" name="freeDeliver" value="${sc.value.freeDeliver}" />
										<input type="hidden" name="taxPrice"
											value="${sc.value.taxPrice}" />
										<input type="hidden" name="price" value="${sc.value.price}" />
										<input type="hidden" name="getPoint"
											value="${sc.value.getPoint}" />
										<li style="float:none;">
											<span style="margin: 0px"><a href="${ctx}/product/productMessage.do?method=shopDeatails&id=${sc.value.id}" target="_blank">
													<img src="${ctx}/product_image/${sc.value.id}_1_50X50.jpg" border="0px"
														width="50px" height="50px" /> </a> </span>
											<span style="width: 280px"><a href="${ctx}/product/productMessage.do?method=shopDeatails&id=${sc.value.id}" target="_blank"
												class="text_ad"> ${sc.value.name} </a> </span>
											<input type="hidden" name="key" value="${sc.key}">
											<span id="shopPrice${sc.key}">单价</span>
											<span id="shopPriceSum${sc.key}">￥小计</span>
											<span id="point${sc.key}">积分小计</span>
											<span style="margin-top: 15px"><label>
													<input type="hidden" name="hiddIsNeedPaper"
														value="${sc.value.isNeedPaper}" />
													<select name="isNeedPaper"
														onchange="javascript:changeValue(${sc.key},this)" size="1"
														disabled="disabled">
														<option value="0">
															否
														</option>
														<option value="1">
															是
														</option>

													</select>
												</label> </span>
											<input type="hidden" name="quantity"
												value="${sc.value.quantity}">
											<span> ${sc.value.quantity}</span>
											<div class="clearAll"></div>
										</li>
									</logic:iterate>
									<logic:iterate id="frees" name="free" scope="session">
								    <li style="float:none;">
										<span style="margin: 0px"><a href="${ctx}/product/productMessage.do?method=shopDeatails&id=${frees.value.id}" target="_blank">
												<img src="${ctx}/product_image/${frees.value.id}_1_50X50.jpg" border="0px" width="50px" height="50px"/>
										</a> 
										</span>
										<span style="width: 280px"><a href="${ctx}/product/productMessage.do?method=shopDeatails&id=${frees.value.id}" target="_blank"
											class="text_ad">  ${frees.value.name}</a> 
										</span>
										<span >赠品</span>
										
										<span style="margin-top: 15px"><label>
												——
											</label> </span>
											<span style="margin-top: 15px">
											 <label>
												——
											</label>
											</span>
											<span >——</span>
											<span>
										     ${frees.value.quantity}
										    </span>
											<div class="clearAll"></div>
									</li>									
									
							</logic:iterate>								
								</logic:present>
							</ul>
						</div>
						<div class="cont_bottom"  style="float:none;">
							<div class="cont_left">
								<ul style="float:none;">
									<li style="float:none;">
										使用帐户余额
										<label>
											<input type="text" id="userbalance1"  maxlength="7"/>
										</label>
										元
										<a href="javascript:editCash();"><img src="${ctx}/images/shiyong.jpg" /border="0" /></a>
											您可使用的余额为<span id="cash">
											<bean:write name="cash" format="0.00" /> 
											</span>元 
									</li>
									<li id="shiyongpoint" style="float:none;">
										使用积分
										<label>
											&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="usepoint1" maxlength="7"/>
										</label>
										元
										<a href="javascript:editUserPoint();"><img src="${ctx}/images/shiyong.jpg" /border="0" /></a>
											您可使用的积分为<span id="userPoint">${point}</span>分
									</li>
									<li>
										使用优惠券
										<label>
											&nbsp;&nbsp;<input type="text" name="ecouponno" id="ecouponno"/>
										</label>
										&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="useEcoupon()"><img src="${ctx}/images/shiyong.jpg" /border="0"/>
										优惠金额 <span id="shen">0</span> 元</a>
										<input type="button" onclick="resetShen()" value="取消使用优惠卷"/>
									</li> 
									<li>
										注：用户余额只适用于产品金额抵消。
									</li>
									<li style="height:0;border:0;font-size:0;padding:0;margin:0;clear:all;"></li>
								</ul>
							</div>
							<div class="cont_right">
								<ul style="float:none;">
									<li style="float:none;">
										商品金额共计：<span id="spanTotalSum">${totalSum}</span> 元
									</li>
									<li style="float:none;">
										商品积分共计： <span id="spanPointSum">${pointSum}</span>分
									</li>
									<li style="float:none;">
										手续费： <span id="poundage">0</span> 元
										<input type="hidden" name="hiddpoundage" id="hiddpoundage" value="0">
									</li>
									<li style="float:none;">
										运费：<span id="freight"></span>元
										<input type="hidden" name="needcarriage" id="needcarriage" value="0"/>
 									</li>
									<li style="float:none;">
										使用帐户余额：<span id="usebalance">0.00</span> 元
										<input type="hidden" name="usebalance" id="hiddusebalance" value="0"/>
									</li>
									<li id="shiyongpoint2" style="float:none;">
										使用积分： <span id="usepoint">0</span>分
										<input type="hidden" name="usepoint" id="hiddusepoint" value="0"/>
									</li>
									<li>
										优惠券冲抵：<span id="useticket">0</span> 元
									</li>
									<li style="float:none;">
										您共需要支付：
										<span class="price" id="needPrice"></span> 元
										<input type="hidden" name="needpay" id="needpay" value="0"/>
									</li>
								</ul>
							</div>
							<div class="clearAll"></div>
						</div>
						<div class="cont_bottom" style="float:none;">
							<div class="cont_left">
								<ul style="float:none;">
									<li style="line-height: 0px;float:none;">
										客户留言：
									</li>
									<li style="line-height: 0px;float:none;">
										如果您有特别的需要，请在这里注明具体情况
									</li>
									<li style="line-height: 0px;float:none;">
										<label>
											<textarea name="customerword"></textarea>
										</label>
									</li>
								</ul>
							</div>
							<div class="cont_right">
								<ul style="float:none;">
									<li style="float:none;">
										发票类型：<span id="spanInvoicetype">
										<logic:equal value="1"  name="invoicetype"  scope="session">普通发票</logic:equal>
							            <logic:equal value="2"  name="invoicetype"  scope="session">增值税发票</logic:equal>
                                        </span>
									</li>
									<li style="float:none;">
										发票抬头：<span id="spanInvoicecompanytText">${invoicecompanytText}</span>
									</li>
									<li style="float:none;">
										发票内容：<span id="spanInvoicecontent">
										<logic:equal value="1"  name="invoicecontent"  scope="session">明细</logic:equal>
							            <logic:equal value="2"  name="invoicecontent"  scope="session">办公用品</logic:equal>
                                        <logic:equal value="3"  name="invoicecontent"  scope="session">电脑配件</logic:equal>
							            <logic:equal value="4"  name="invoicecontent"  scope="session">耗材</logic:equal>
							            <logic:equal value="5"  name="invoicecontent"  scope="session">&nbsp;</logic:equal>
							            </span>
									</li>
									<li style="float:none;">
										<a href="#" onclick="javascript:openWindow()">修改发票信息</a>
									</li>
								</ul>
							</div>
							<div class="clearAll"></div>
						</div>
		
		<div class="cont_bottom" align="center">
			<a href="javascript:submitForm('orderForm');" ><img
					src="${ctx}/images/checkout_tijiap.jpg" /border="0" />
			</a>
			<a href="${ctx}/shopping/viewShoppingCart.do?m=show"><img src="${ctx}/images/checkout_back.jpg"
					/border="0">
			</a>
		</div>
		
		</div><!-- 大div结束-->
		<div class="cont_bottom" align="center" style="float:none;">
			<br />
			<br />
			销售服务热线：400-810-3859│ 京ICP证080632号 │锐意网 版权所有
			<br />
			<br />
			<img src="${ctx}/images/red.jpg" / border="0" />
			<img src="${ctx}/images/alipay.jpg" />
		</div>
		</div>
		</div>
		</div>
		<input type="hidden" id="isCloseDivId" value="otherAddress" />
		
	
	<!-- 覆盖层 -->
			<div id="fg"></div>
            <!--要发票提示-->
			<div id="toInvoice" class="invoice" style="display:none;background-color:white;
                border:1px solid #336699; position:absolute;left:50%; top:30%; 
                font:12px Verdana,'宋体',Arial,sans-serif;margin-left:-200px; 
                margin-top:npx; width:400px;text-align:center;
                z-index:100001;">
                <ul>
                <li style="color:#5a3e2e">索要发票<a href="${ctx}/pages/safeai/jsp/help/repair.jsp" target="_blank"  class="invoice_baoxiu">保修详情</a></li>
                <li style=" background-color:#efefef">* 发票金额以提交订单前最终金额为准。</li>
                <li>您的购物车里有 <span  style="color:#F4972D" id="invoiceCountSumSpan">${invoiceCountsum}</span> 件商品需要开发票，请填写发票信息</li>
                <li>发票类型：
                   	<logic:equal value="1"  name="invoicetype"  scope="session">
                   	<label><input type="radio" name="invoicetype" value="1" checked="checked" onclick="javascript:openZzs();"/></label>普通发票</logic:equal>
                   	<logic:notEqual value="1" name="invoicetype"  scope="session">
                   	<label><input type="radio" name="invoicetype" value="1" onclick="javascript:openZzs();"/></label>普通发票</logic:notEqual>
					<logic:equal value="2"  name="invoicetype"  scope="session">
					<label><input type="radio" name="invoicetype" value="2" checked="checked" onclick="javascript:openZzs();"/></label>增值税发票</logic:equal>
					<logic:notEqual value="2" name="invoicetype"  scope="session">
					<label><input type="radio" name="invoicetype" value="2"  onclick="javascript:openZzs();"/></label>增值税发票</logic:notEqual>
                <span style="padding-left:67px;width:auto;display:none" id="zzs">
                	需要开具增值税专用发票的客户需准备好加盖公章的营业执照副本、税务登记证副本、一般纳税人资格证书，并准备好开票信息、开户行、帐号，
                	然后拨打400-810-3859联系锐意客服。
                </span>
                </li>
                
                <span id="fzzs">
                <li>发票抬头：
                <logic:equal value="1" name="invoiceCompany" scope="session">
                <label><input type="radio" name="invoiceCompany" value="1" checked="checked"/></label> 个人</logic:equal>
                <logic:notEqual value="1" name="invoiceCompany" scope="session">
                <label><input type="radio" name="invoiceCompany" value="1"/></label> 个人</logic:notEqual>
                 <logic:equal value="2" name="invoiceCompany" scope="session">
                <label><input type="radio" name="invoiceCompany" value="2" checked="checked"/></label> 单位</logic:equal>
                <logic:notEqual value="2" name="invoiceCompany" scope="session">
                <label><input type="radio" name="invoiceCompany" value="2"/></label> 单位</logic:notEqual>
                　</li>
                <li style="padding-left:67px;width:100px"><label><input type="text" name="invoicecompanytText" id="invoicecompanytText"  maxlength="200" value ="${invoicecompanytText}" /  class="invoice_input"></label></li>
                <li>发票内容：
                <logic:equal value="1" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="1" checked="checked" onclick="javascript:setHiddeninvoicecontent();"/></label> 明细</logic:equal>
                <logic:notEqual value="1" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="1" onclick="javascript:setHiddeninvoicecontent();"/></label> 明细</logic:notEqual>
                
                 <logic:equal value="2" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="2" checked="checked" onclick="javascript:setHiddeninvoicecontent();"/></label> 办公用品</logic:equal>
                <logic:notEqual value="2" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="2" onclick="javascript:setHiddeninvoicecontent();"/></label> 办公用品</logic:notEqual>
                
                 <logic:equal value="3" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="3" checked="checked" onclick="javascript:setHiddeninvoicecontent();"/></label> 电脑配件</logic:equal>
                <logic:notEqual value="3" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="3" onclick="javascript:setHiddeninvoicecontent();"/></label> 电脑配件</logic:notEqual>
                
                <logic:equal value="4" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="4" checked="checked" onclick="javascript:setHiddeninvoicecontent();"/></label> 耗材</logic:equal>
                <logic:notEqual value="4" name="invoicecontent" scope="session">
                <label><input type="radio" name="invoicecontent" value="4" onclick="javascript:setHiddeninvoicecontent();"/></label> 耗材</logic:notEqual>
                　</li>
				</span>
                <li style="margin-top:20px; height:30px;text-align:center">
                　<a href="#"  class="reg_button " onmousedown="javascript:closeWinodw('toInvoice'),editInvioce();">提交发票信息</a></li>
                <div style="width:0;height:0;padding:0;margin:0;clear:both"></div>
                </ul>   
           </div>
			<!-- 不要发票提示 -->
			<div class="invoice" id="notToInvoice" style="display:none;background-color:white;
                border:1px solid #336699; position:absolute;left:50%; top:30%; 
                font:12px Verdana,'宋体',Arial,sans-serif;margin-left:-200px; 
                margin-top:npx; width:400px; height:220px;text-align:center;
                z-index:100001;">
                <ul>
					<li style="color:#5a3e2e">您未选择开具发票，同样可以得到锐意网完善的售后服务。</li><li>查看<a href="${ctx}/pages/safeai/jsp/help/repair.jsp" target="_blank"  class="invoice_baoxiu">保修详情</a></li>
					<li>如果您需要开具发票请点击　<a href="${ctx}/shopping/viewShoppingCart.do?m=show"  class="invoice_baoxiu">返回购物车</a></li>
					<li style="margin-top:20px; height:30px;text-align:center">					 
					<a href="#" onmousedown="javascript:closeWinodw('notToInvoice')" class="reg_button ">关闭此页面</a>　
					</li>

				</ul>
           	</div>
           		<input type="hidden" name="sfkaifp" id="sfkaifp"/>
           	    <input type="hidden" name="totalSum" id="totalSum" value="${totalSum}"/>
           		<input type="hidden" name="invoiceSum" id="invoiceSum" value="${invoiceSum}"/>
           		<input type="hidden" name="invoiceCountsum" id="invoiceCountsum" value="${invoiceCountsum}"/>
           		<input type="hidden" name="pointsum" id="pointsum" value="${pointSum}"/>
                <input type="hidden" name="hiddeninvoicecontent" id="hiddeninvoicecontent" value="1"/>
                <input type="hidden" id="ctx" value="${ctx}"/>
                <input type="hidden" id="flag1" value="${flag1}"/>
                <input type="hidden" id="flag2" value="${flag2}"/>
                <input type="hidden" id="vipFlag" value="${vipFlag}"/>
         </html:form>
	</body>
	<script type="text/javascript">
//页面加载事件*******************************************************************************
window.onload=function(){//1 start
   try{
       //防止后退
       defense();
       //取得所有商品的不含税价格
       var price=document.getElementsByName("price");
       //取得所有商品的含税价格
       var taxPrice=document.getElementsByName("taxPrice");
       //取得所有商品的是否开发票属性1
       var hiddIsNeedPaper=document.getElementsByName("hiddIsNeedPaper");
       //取得所有商品的是否开发票属性2
       var isNeedPaper=document.getElementsByName("isNeedPaper");
       //取得所有商品的购买数量
       var quantity=document.getElementsByName("quantity");
       //每个单品赠送积分
       var getPoint=document.getElementsByName("getPoint");
 
       this.onloadcheck(price,taxPrice,hiddIsNeedPaper,isNeedPaper,quantity,getPoint);
       //城市级联
       onload2();
       //覆盖层初始化
       onloddiv();
       //发票信息初始化1
       openZzs();
       //发票信息初始化2
       setHiddeninvoicecontent();
       //初始化发票信息显示
       editInvioce();
       var flag1=document.getElementById("flag1");
       if(flag1.value==1){
          alert("帐户余额不足！");
       }
       var flag2=document.getElementById("flag2");
       if(flag2.value==1){
          alert("积分余额不足！");
       }
       var shiyongpoint=document.getElementById("shiyongpoint");
       var shiyongpoint2=document.getElementById("shiyongpoint2");
       var vipFlaghidd=document.getElementById("vipFlag");
       if(vipFlaghidd.value==1){
           shiyongpoint.style.display="none";
           shiyongpoint2.style.display="none";
       }
   }catch(exception){
      //刷新页面
      document.location.reload(true);
   }
   
}//1 end

//计算小计算和总计
function onloadcheck(price,taxPrice,hiddIsNeedPaper,isNeedPaper,quantity,getPoint){
   //获取所有商品的id
   var keys=document.getElementsByName("key");
   
   //商品金额总计
   var total=0;
   //开发票金额总计
   var invoiceSum=0;
   //开发票的商品数量和
   var invoiceCountsum=0;
   //所有商品数量和
   var number=0;
   //商品积分总和
   var pointsum=0;
  
  for(var i=0;i<keys.length;i++){//for start
     //获取显示单价位置
     var shopPrice=document.getElementById("shopPrice"+keys[i].value);
     //获取显示小计位置
     var shopPriceSum=document.getElementById("shopPriceSum"+keys[i].value);
     //获取显示积分小计位置
     var point=document.getElementById("point"+keys[i].value);
     //shopPrice.innerHTML="cccccccc";
     //单价价格
     var shopPricei=0;
     if(hiddIsNeedPaper[i].value==0){//if 1 start
               //单价为不含税价格
               shopPricei=new Number(price[i].value);
               isNeedPaper[i].selectedIndex ="0";
           }else{
               //单价为含税价格
               shopPricei=new Number(taxPrice[i].value);
               isNeedPaper[i].selectedIndex ="1";
           }//if 1 end
     //显示单价
     shopPrice.innerHTML=shopPricei.toFixed(2);
     //显示小计
     var xiaoji=new Number(shopPricei*quantity[i].value);
     shopPriceSum.innerHTML=xiaoji.toFixed(2);
     //计算商品金额总计
     total+=xiaoji;
     if(isNeedPaper[i].value==1){//if 1 start
               //开发票金额总计
               invoiceSum+=xiaoji;
               //计算开发票商品数量
               invoiceCountsum+=new Number(quantity[i].value);
     }
     //计算购物车商品数量
     number+=new Number(quantity[i].value);
     //计算积分小计
     var jifen=new Number(getPoint[i].value*quantity[i].value);
     //显示积分小计
     point.innerHTML=jifen;
     //计算积分总额
     pointsum+=jifen;
  }//for end
}
//根据是否开发票更改价格
 function changeValue(id,o){
  //取得所有商品的不含税价格
   var price=document.getElementsByName("price");
   //取得所有商品的含税价格
   var taxPrice=document.getElementsByName("taxPrice");
   //取得所有商品的是否开发票属性
   var isNeedPaper=document.getElementsByName("isNeedPaper");
   //取得所有商品的是否开发票属性
   var hiddIsNeedPaper=document.getElementsByName("hiddIsNeedPaper");
   //每个单品赠送积分
   var getPoint=document.getElementsByName("getPoint");
   
   for(var i=0;i<isNeedPaper.length;i++){
     hiddIsNeedPaper[i].value=isNeedPaper[i].value;
   }
   //取得所有商品的单个商品购买数量
   var quantity=document.getElementsByName("quantity");
   //从新计算价格
   this.onloadcheck(price,taxPrice,hiddIsNeedPaper,isNeedPaper,quantity,getPoint);
   //改变订单商品属性
   this.csAjax(id,o);
}



//ajax******************************************************************************
     
  //更改购物车中指定商品是否开发票属性
  function csAjax(id,o){
  //select 选中值
  var selecto=o.value;
        xhr = false;
        var ctx=document.getElementById("ctx");
        var url=ctx.value+"/shopping/viewShoppingCart.do";
        var _parameter="m=xmlajax&id="+id+"&isNeedPaper=" + selecto;
        var ajax=new Ajax();
        ajax.ajaxRequest(url,_parameter,'get',alertAjax);
   }
//ajax返回函数
   function alertAjax(test){}
    //弹出层****************************************************************************************  
function openWindow(){
   sWidth=document.body.clientWidth;//document.body.offsetWidth;//浏览器工作区域内页面宽度
   sHeight=document.body.clientHeight;//document.body.offsetHeight;//屏幕高度（垂直分辨率）
   //取得所有商品的是否开发票属性
   var isNeedPaper=document.getElementsByName("isNeedPaper");
   //判断是否有商品
   if(isNeedPaper.length>0){
       //储存是否有需要发票的内容“0”没有 “1”有
       var isNeed=0;
       //循环判断是否有需要发票的商品
       for(var i=0;i<isNeedPaper.length;i++){
          if(isNeedPaper[i].value=="1"){
          isNeed=1;
          break;
          }  
       }
       //打开覆盖层
       //var fg=document.getElementById("fg");
       //fg.style.display="block";
       openCover();
       //fg.style.width=sWidth+"px";
       //fg.style.height=sHeight+"px";
       //fg.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
       if(isNeed==1){//如果要发票
            var toInvoice=document.getElementById("toInvoice");
            toInvoice.style.display="";
       }else{//如果不要发票
            var notToInvoice=document.getElementById("notToInvoice");
            notToInvoice.style.display="";
       }
    }else{//如果没有商品则弹出提示
       alert("您没有选购商品！！");
    }
}
//关闭浮动层
function closeWinodw(divname){
    isFaPiaoTop=0;//如果有发票抬头则可以通过
 	if(divname=='toInvoice'){
	    //获取所有发票类型
	    var invoicetype=document.getElementsByName("invoicetype");
	    for(var i=0;i<invoicetype.length;i++){
	        if(invoicetype[i].checked==true){//判断那个被选中
	            if(invoicetype[i].value==1){//是否是普通发票
	                var textfield=document.getElementById("invoicecompanytText");
	                if(textfield.value==""){
	                    isFaPiaoTop=1;//提交发票信息，不允许不正常提交
	                    alert("发票抬头不能为空！");
	                    return;
	                }
	            }
	        }
	    }
	}
 var div=document.getElementById(divname);
 div.style.display="none";
 closeCover();
}
//弹出层内部的显示与隐藏
  function openZzs(){
     var invoicetypes=document.getElementsByName("invoicetype");
     //所有明细
     var invoicecontents=document.getElementsByName("invoicecontent");
     //保存明细信息的隐含域
     var hiddeninvoicecontent=document.getElementById("hiddeninvoicecontent");
     //如果是增值税发票则显示
     var zzs =document.getElementById("zzs");
     //如果不是增值税发票则显示
     var fzzs=document.getElementById("fzzs");
     for(var i=0;i<invoicetypes.length;i++){
         //判断是否被选中
         if(invoicetypes[i].checked==true){
            if(invoicetypes[i].value==1){//1普通发票 ，2增值税发票
                fzzs.style.display="block";
                zzs.style.display="none";
                var boolzz=false;//判断是否有被选中的
                for(var j=0;j<invoicecontents.length;j++){
                    if(invoicecontents[j].checked==true){
                        hiddeninvoicecontent.value=invoicecontents[j].value;
                        boolzz=true;
                    }
                }
                if(!boolzz){//如果没有被选中的则设置明细为默认选中
                    invoicecontents[0].checked=true;
                    hiddeninvoicecontent.value="1";
                }
            }else{
                fzzs.style.display="none";
                zzs.style.display="block";
                hiddeninvoicecontent.value=5;
            }
         }
     } 
      
  }
  //弹出层中 客户选择发票内容事件
  function setHiddeninvoicecontent(){
      var invoicecontents=document.getElementsByName("invoicecontent");
      for(var i=0;i<invoicecontents.length;i++){
          if(invoicecontents[i].checked==true){
              //保存明细信息的隐含域
              var hiddeninvoicecontent=document.getElementById("hiddeninvoicecontent");
              hiddeninvoicecontent.value=invoicecontents[i].value;
          }
      }
  }
    //*********************************************************************************************************
    //要关闭的层的id
    
    //隐藏div1，显示div2
    function openDiv(div1,div2){
      isSubmit=0;
      var div1=document.getElementById(div1);
      var div2=document.getElementById(div2);
       //if(div1!=div2){
          div1.style.display="none";
       //}
        div2.style.display="";
    }
    
    //返回上次显示层的id
    function getIsDivID(){
       var divID=document.getElementById("isCloseDivId").value;
       return divID;
    }
    //保存这次要显示层的id
    function inputDivId(divid){
      //获得存储显示的层id的对象
      var divObject=document.getElementById("isCloseDivId");
      divObject.value=divid;
    }
    //提交form的方法
    function submitForm(name){
        if(isSubmit==0){
            alert("请重新核对订单信息。");
            return;
        }else if(isFaPiaoTop==1){
           alert("请填写发票抬头！发票抬头不能为空！");
           return;
        }
	var forms=document.getElementsByName(name);
	for(var i=0;i<forms.length;i++){
	    forms[i].submit();
	}
	
  	}
  	
  	function sfkaifp(isneedpaper){
    var sfkaifp=document.getElementById("sfkaifp");
    sfkaifp.value=isneedpaper;
 	}
  //****************************城市级联**************************************************
  
    
  
  
     var selectid=0;
  //页面信息初始化
  function onload2(){//onload start
    //所有需要级联的省select控件
    var selectProvince0 = document.getElementById("selectProvince0");
    var selectProvince1 = document.getElementById("selectProvince1");
    var selectProvince2 = document.getElementById("selectProvince2");
    var selectProvince3 = document.getElementById("selectProvince3");
    //所有需要级联的市select控件
    var selectCity0 = document.getElementById("selectCity0");
    var selectCity1 = document.getElementById("selectCity1");
    var selectCity2 = document.getElementById("selectCity2");
    var selectCity3 = document.getElementById("selectCity3");
   
    //所有需要级联的区select控件
    var selectVillage0 = document.getElementById("selectVillage0");
    var selectVillage1 = document.getElementById("selectVillage1");
    var selectVillage2 = document.getElementById("selectVillage2");
    var selectVillage3 = document.getElementById("selectVillage3");
    
    if(selectProvince0){//判断是否存在
      //获得历史信息中省信息     
      var provinceName=selectProvince0.options[selectProvince0.selectedIndex].value;
      getAllProvince(0);
      //重新设置默认值
      selectchecked(selectProvince0,provinceName);
      //获得历史信息中的城市信息
      var cityName=selectCity0.options[selectCity0.selectedIndex].value;
      getAllCity(0);
      //重新设置默认值
      selectchecked(selectCity0,cityName);
      //获得历史信息中的区信息
      var villageName=selectVillage0.options[selectVillage0.selectedIndex].value;
      getAllVillage(0);
      //重新设置默认值
      selectchecked(selectVillage0,villageName);
      //查询邮编
      getZip(0,backZip0);
      selectProvince0.onchange=function(){
         getAllCity(0);
         getAllVillage(0);
         getZip(0,backZip0);
      }
      selectCity0.onchange=function(){
         getAllVillage(0);
         getZip(0,backZip0);
      }
      selectVillage0.onchange=function(){
         getZip(0,backZip0);
      }
    }
    if(selectProvince1){//判断是否存在
      //获得历史信息中省信息     
      var provinceName=selectProvince1.options[selectProvince1.selectedIndex].value;
      getAllProvince(1);
      //重新设置默认值
      selectchecked(selectProvince1,provinceName);
      //获得历史信息中的城市信息
      var cityName=selectCity1.options[selectCity1.selectedIndex].value;
      getAllCity(1);
      //重新设置默认值
      selectchecked(selectCity1,cityName);
      //获得历史信息中的区信息
      var villageName=selectVillage1.options[selectVillage1.selectedIndex].value;
      getAllVillage(1);
      //重新设置默认值
      selectchecked(selectVillage1,villageName);
      //查询邮编
      getZip(1,backZip1);
      selectProvince1.onchange=function(){         
         getAllCity(1);
         getAllVillage(1);
         getZip(1,backZip1);
      }
      selectCity1.onchange=function(){
         getAllVillage(1);
         getZip(1,backZip1);
      }
      selectVillage1.onchange=function(){
         getZip(1,backZip1);
      }
    }
        if(selectProvince2){//判断是否存在
      //获得历史信息中省信息     
      var provinceName=selectProvince2.options[selectProvince2.selectedIndex].value;
      getAllProvince(2);
      //重新设置默认值
      selectchecked(selectProvince2,provinceName);
      //获得历史信息中的城市信息
      var cityName=selectCity2.options[selectCity2.selectedIndex].value;
      getAllCity(2);
      //重新设置默认值
      selectchecked(selectCity2,cityName);
      //获得历史信息中的区信息
      var villageName=selectVillage2.options[selectVillage2.selectedIndex].value;
      getAllVillage(2);
      //重新设置默认值
      selectchecked(selectVillage2,villageName);
      getZip(2,backZip2);
      selectProvince2.onchange=function(){         
         getAllCity(2);
         getAllVillage(2);
         getZip(2,backZip2);
      }
      selectCity2.onchange=function(){
         getAllVillage(2);
         getZip(2,backZip2);
      }
      selectVillage2.onchange=function(){
         getZip(2,backZip2);
      }
    }
     if(selectProvince3){//判断是否存在
      getAllProvince(3);
      getAllCity(3);
      getAllVillage(3);
      getZip(3,backZip3);
      selectProvince3.onchange=function(){         
         getAllCity(3);
         getAllVillage(3);
         getZip(3,backZip3);
      }
      selectCity3.onchange=function(){
         getAllVillage(3);
         getZip(3,backZip3);
      }
      selectVillage3.onchange=function(){
         getZip(3,backZip3);
      }
    }
  }//onload end
  
   /*查询所有省*/
  function getAllProvince(idd){
      selectid=idd;
      var ajax=new Ajax();
      ajax.ajaxRequest("${ctx}/order/cityOreder.do","method=getAllProvince",'get',backProvince);
  }
   /*查询指定省下所有城市*/
  function getAllCity(idd){
      selectid=idd;
      var province=document.getElementById("selectProvince"+selectid);
      var provinceName=province.options[province.selectedIndex].value;
      var ajax=new Ajax();
      ajax.ajaxRequest("${ctx}/order/cityOreder.do","method=getCitys&provinceName="+encodeURI(provinceName),'get',backCity);
  }
   /*查询指定省和城市下所有区域*/
  function getAllVillage(idd){
      selectid=idd;
      var province=document.getElementById("selectProvince"+selectid);
      var provinceName=province.options[province.selectedIndex].value;
      var city=document.getElementById("selectCity"+selectid);
      var cityName=city.options[city.selectedIndex].value;
      var ajax=new Ajax();
      ajax.ajaxRequest("${ctx}/order/cityOreder.do","method=getVillages&provinceName="+encodeURI(provinceName)+"&cityName="+encodeURI(cityName),'get',backVillage);
  }
   /*添加省*/
  function backProvince(str){ 
                var list=str.split(",");
                DWRUtil.removeAllOptions("selectProvince"+selectid);
                var selectprovince=document.getElementById("selectProvince"+selectid);
                //selectprovince.options.add(new Option('--请选择--','--请选择--'));
	            DWRUtil.addOptions("selectProvince"+selectid, list);
  }
   /*添加市*/
  function backCity(str){          
                var list=str.split(",");
                DWRUtil.removeAllOptions("selectCity"+selectid);
                var selectcity=document.getElementById("selectCity"+selectid);
                //selectcity.options.add(new Option('--请选择--','--请选择--'));
	            DWRUtil.addOptions("selectCity"+selectid, list);
  }
  
   /*添加区*/
  function backVillage(str){
                var list=str.split(",");
                DWRUtil.removeAllOptions("selectVillage"+selectid);
                var selectvillage=document.getElementById("selectVillage"+selectid);
                //selectvillage.options.add(new Option('--请选择--','--请选择--'));
	            DWRUtil.addOptions("selectVillage"+selectid, list);
  }
  
  /***********************************防止后退按钮*****************************************************/
function defense(){
    var ajax=new Ajax();
    var ctx=document.getElementById("ctx");
    ajax.ajaxRequest(ctx.value+"/shopping/viewShoppingCart.do","m=Defense",'GET',backDefense)
}

function backDefense(yemian){
   var ctx=document.getElementById("ctx");
   if(yemian!="checkout.jsp"){     
          history.go(1);
          return;
   }
}

/***********************************ajax校验优惠卷*****************************************************/
	function useEcoupon(){ 
   		var ajax=new Ajax();
		var ecouponno = document.getElementById("ecouponno").value;
		var needpay =document.getElementById("needpay").value;
   		ajax.ajaxRequest("${ctx}/shopping/useEcoupon.do","method=useEcoupon&ecouponno="+ecouponno+"&needpay="+needpay,'get',userEcoResult);
   	}
	function userEcoResult(str){
		if(str.indexOf("OK")<0){
			alert(str);	
			document.getElementById("shen").innerHTML=0;
		}else{
			var mon = str.split(",");
			document.getElementById("shen").innerHTML=mon[1];
		    checkoutCountSum();
		}
	}
	function resetShen(){
		document.getElementById("shen").innerHTML=0;
		checkoutCountSum();
	}


	</script>
</html>
